<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="java.sql.*" %><!-- 数据库操作需要 -->  
<%@page import="beans.*" %>
<%@page import="java.util.List" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>用车申请审核表</title>
    <link rel="stylesheet" href="UC_style.css">
    <style>
        .main {
            width: 100%;
            height: 800px;
            background: RGB(239,239,239);
            float: left;
        }

        #header2 {
            height: 40px;
            background: white;
        }

        table,
        th,
        td {
            background-color: white;
            border: 1px solid black;
            border-collapse: collapse;
           
        }

        td {
            width: 200px;
            height: 25px;
            padding: 5px;
           
        }

        th {
            font-size: 16px;
        }

        .had {
            text-align: center;
            height: 600px;
            width: 80%;
            margin: 0px auto;
        }

        .input1 {
            border: none;
            height: 90%;
            width: 100%;
            font-size:16px;
            outline:none;
        }
        .input2 {
            color: black;
            background-color: RGB(239,239,239);
            font-size: 20px;
            height: 40px;
            width: 100px;
            margin-left:150px;
            margin-right:150px;
            
        }
        .input2:hover{
            background-color:#808080;
        }
        .text{
        	border: none;
            height: 50px;
            width: 100%;
            font-size:16px;
          	
        }

        select {
            border: 0px;
            height: 90%;
            width: 90%;
            outline:none;
        }

        textarea {
            border: 0px;
            
            width: 100%;
            resize: none;
            font-size: 16px;
        }

        .button1 {
            height: 40px;
            width: 120px;
            font-size: 15px;
            margin-left: 1000px;
            position:center;
            color: #000000;
            background-color: #808080;
        }

        h2 {
            text-align: center;
        }
        .button_file{
			background-color: white;
    		color:RGB(64,158,255);    		
    		height:22px;
   	 		text-align: center;
    		font-size: 16px;
    		border:none;
    		font-weight:bold;
		}
		.button_file:hover {
    		background-color:RGB(249,249,249);
		}
		.button_file:active {
 			 transform: translateY(2px);
		}
    </style>
</head>

<body>
<%	
	String first=(String)request.getAttribute("first");
	
	String ID=(String)session.getAttribute("ID");
	String RequestID=request.getParameter("RequestID");
	System.out.println("Se:"+first+"RE:"+RequestID+"ID:"+ID);

	String Adminname=null;
	String Status=null;
	
	CarRequestBean list=(CarRequestBean)request.getAttribute("User");
	AdminBean Admin=(AdminBean)request.getAttribute("Admin");

	Status=list.getStatus();
	System.out.println("Statsu:"+Status);
%>
    <div class="main">
        <div id="header2">
            <img src="img/申请用车.png" alt="Big Boat" width="30" height="30" style=" vertical-align: middle;">
            乘客用车管理 > 申请用车
        </div>
        <h2>用车申请表</h2>
        <form action="C_Servlet" method="get">
        <table class="had">
            
                <tr>
                    <th>乘车人数：</th>
                    <td><input class="input1" type="number" id="UsersNum" name="UsersNum" min="1" max="6" value=<%=list.getUsersNum() %> readonly></td>
                    <th>用车范围：</th>
                    <td>
                        <input type="text" class="input1" value=<%=list.getUseRange() %> readonly>
                    </td>
                    <th>联系电话：</th>
                    <td><input class="input1" type="text" id="Userphone" name="Userphone" value=<%=list.getUserphone() %> readonly></td>
                </tr>
                <tr>
                    <th>用车时间：</th>
                    <td><input class="input1" type="datetime-local"  id="UseTime" name="UseTime" value=<%=list.getUseTime() %> readonly></td>
                    <th>返回时间：</th>
                    <td><input class="input1" type="datetime-local"  id="ReturnTime" name="ReturnTime" value=<%=list.getReturnTime() %> readonly></td>
                    <th>紧急程度：</th>
                    <td>
                        <input type="text" class="input1" value=<%=list.getdegree()%> readonly>
                    </td>
                </tr>
                <tr>
                    <th>申请人工号：</th>
                    <td><input class="input1" type="text" id="EmpID" name="EmpID" value=<%=list.getEmpID() %> readonly></td>
                    <th>申请时间：</th>
                    <td><input class="input1" type="text"  id="applyTime" name="applyTime" value=<%=list.getapplyTime() %> readonly></td>
                    <th>申请部门：</th>
                    <td>
                       
                        <input type="text" class="input1" value=<%=list.getapplyDepartment() %> readonly>
                    </td>
                </tr>
            
            
                <tr>
                    <th>起始地点</th>
                    <td colspan="2"><input class="input1" type="text" id="origin" name="origin" value=<%=list.getorigin() %> readonly></td>
                    <th>前往地点</th>
                    <td colspan="2"><input class="input1" type="text" id="goPlace" name="goPlace"value=<%=list.getgoPlace() %> readonly></td>
                </tr>
                <tr>
                    <th style="height:100px">用车事由</th>
                    <td colspan="5"><textarea id="UseReasons" name="UseReasons" rows="8" cols="30" style="outline:none;"readonly><%=list.getUseReasons() %> </textarea></td>
                </tr>
            
            
                <tr >
                    <th >备注</th>
                    <td colspan="5" ><textarea id="Remarks" name="Remarks" rows="3" cols="30" style="outline:none;"readonly><%=list.getRemarks() %> </textarea></td>
                </tr>
           		<tr>
                    <th style="height:50px">附件</th>
                    <td colspan="5" style="text-align:left">	
                    	<input type="button" class="button_file" value="添加附件" onclick="path.click()" >					
						<input type="text" class="text" name="lookfile" id="lookfile" style="outline:none;" value=<%=list.getAttachment() %> readonly>											
						<input type="file"  id="Attachment" name="Attachment" style="display:none" onchange="lookfile.value+='   '+this.value">								
					</td>
                </tr> 
                <tr>
                	<th style="height:100px" rowspan="3">审核意见</th>
                	<td colspan="5" style="padding:0px;text-align:left;">
                    	<select id="AgreeOrNot" name="AgreeOrNot" style="height:28px;width:30%;">
                        	<option value="" selected disabled hidden>请选择是否同意</option>
                            <option value="同意">同意</option>
                            <option value="不同意，退回修改">不同意，退回修改</option>
                            <option value="不同意，结束任务">不同意，结束任务</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="5" ><textarea rows="3" cols="30" style="outline:none;" id="CensorContent" name="CensorContent"required></textarea></td>                 
                </tr>
                <tr>
                	<td colspan="5" style="text-align:right;">
                		<div style="float:right;width:100%">
                			审核人：<input type="text" id="Adminname" name="Adminname" style="border:none;outline:none;width:150px;height:20px;white-space: nowrap;color:RGB(153,153,153);" value=<%=Admin.getAdminname()%> readonly>
                			审核时间：<input type="text" id="AdminTime" name="AdminTime" style="border:none;outline:none;width:150px;height:20px;color:RGB(153,153,153);"readonly>
                		</div>
                	</td>
                </tr>
        </table>
        <br/>
        <input type="hidden" name="RequestID" value=<%=RequestID %>>
        <input type="button" onclick="Return()" class="input2" value="返回" style="white-space: nowrap;">
        <input type="submit" onclick="test()" class="input2" value="提交" style="white-space: nowrap;">
        <input type="hidden" name="action" value="C_AdminSubmit">
        <input type="reset" class="input2" value="清空">
        </form>
    </div>
    
 <script type="text/javascript">
 function gettime() {
     var time = new Date();
     var hour = time.getHours();
     var min = time.getMinutes();
     var sec = time.getSeconds();
     var madetime = time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate() ;
     document.getElementById("AdminTime").value = madetime;
 }
 gettime();//显示第一秒的时间
 setInterval("gettime()", 1000);
 function Return()
 {	
	 
	 var S='<%=Status%>';
	 if(S=="待审核")
	 	window.location.href="C-Use_Check.jsp";
	 else if(S=="审核通过")
		 window.location.href="C-success.jsp";
	 else
		 window.location.href="C-fail.jsp";
 }
 </script>
   

</body>

</html>
